<!DOCTYPE html>
<html lang="en">
<head>
    <title>Document</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="lib/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="lib/layui/css/layui.css">
    <script src="lib/layui/layui.js"></script>
    <script src="lib/jquery-1.12.4.min.js"></script>
    <script>
        document.write('<link rel="stylesheet" href="lib/common.css?t=' + new Date().getTime() + '">')
        document.write('<script src="lib/lib.js?t=' + new Date().getTime() + '"><\/script\>')
        document.write('<script src="lib/api.js?t=' + new Date().getTime() + '"><\/script\>')
    </script>

    <style>
        body{
            overflow: hidden;
        }
        .form-horizontal .control-group{
            margin-bottom: 0;
        }
       .form-horizontal .control-label{
            width: 100px;
       }
       .form-horizontal .controls{
            margin-left: 110px;
       }
       .form-horizontal .controls span{
            line-height: 30px;
       }
       table{
        width: 100%;
       }
    </style>
</head>
<body>
    <form class="form-horizontal" style="margin-top: 10px;" id="form">
        <table>
            <tr>
                <td>
                    <div class="control-group">
                        <label class="control-label" for="name">公司名称</label>
                        <div class="controls">
                            <span id="name"></span>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="control-group">
                        <label class="control-label" for="phone">电话</label>
                        <div class="controls">
                            <span id="phone"></span>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="control-group">
                        <label class="control-label" for="bizManager1">业务经理1</label>
                        <div class="controls">
                            <span id="bizManager1"></span>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="control-group">
                        <label class="control-label" for="bizManager2">业务经理2</label>
                        <div class="controls">
                            <span id="bizManager2"></span>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="control-group">
                        <label class="control-label" for="bizManager3">业务经理3</label>
                        <div class="controls">
                            <span id="bizManager3"></span>
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </form>
    <script>
        var id = getUrlParams('id')
        var layer
        layui.use(['layer'], function(){
            layer = layui.layer
            $(document).on('keydown', function(ev){
                if(ev.keyCode==27){
                    var index = parent.layer.getFrameIndex(window.name)
                    parent.layer.close(index)
                }
            })
        })
        var page = {
            companyDetail: function () {
                var post = {
                    id: id
                }
                api.companyDetail(post, function (res){
                    if (res.code==200) {
                        var data = res.data
                        $("#name").html(data.name)
                        $("#phone").html(data.phone)
                        $("#bizManager1").html(data.bizManager1)
                        $("#bizManager2").html(data.bizManager2)
                        $("#bizManager3").html(data.bizManager3)
                    }
                })
            }
        }
        page.companyDetail()

    </script>
</body>
</html>
